﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MySQLStudio.BusinessLogic
{
    public class SqlExecutionContext
    {
        private string m_hostname;
        private int m_portNumber;
        private string m_username;
        private string m_password;
        private string m_database;       
        private string m_sqlStatement;
        
        public string Hostname
        {
            get { return m_hostname; }
            set { m_hostname = value; }
        }

        public int PortNumber
        {
            get { return m_portNumber; }
            set { m_portNumber = value; }
        }

        public string Username
        {
            get { return m_username; }
            set { m_username = value; }
        }

        public string Password
        {
            get { return m_password; }
            set { m_password = value; }
        }

        public string Database
        {
            get { return m_database; }
            set { m_database = value; }
        }

        public string SqlStatement
        {
            get { return m_sqlStatement; }
            set { m_sqlStatement = value; }
        }


        public string ConnectionString
        {
            get
            {
                return string.Format("Data Source={0};Port={1};Initial Catalog={2};User ID={3};Password={4};",
                                      this.m_hostname,
                                      Convert.ToString(this.m_portNumber),
                                      this.m_database,
                                      this.m_username,
                                      this.m_password);
            }
        }
    }
}
